#! /bin/bash

set -e

echo 'tar -zxvf /opt/software/apache-zookeeper-3.5.7-bin.tar.gz -C /opt/module/'
tar -zxvf /opt/software/apache-zookeeper-3.5.7-bin.tar.gz -C /opt/module/

echo 'mv /opt/module/apache-zookeeper-3.5.7-bin /opt/module/zookeeper-3.5.7'
mv /opt/module/apache-zookeeper-3.5.7-bin /opt/module/zookeeper-3.5.7

echo 'mv /opt/module/apache-zookeeper-3.5.7-bin /opt/module/zookeeper-3.5.7'
mv /opt/module/zookeeper-3.5.7/conf/zoo_sample.cfg /opt/module/zookeeper-3.5.7/conf/zoo.cfg

tee -a /etc/profile.d/set_env.sh <<-'EOF'
#ZOOKEEPER_HOME
export ZOOKEEPER_HOME=/opt/module/zookeeper-3.5.7
export PATH=$PATH:$ZOOKEEPER_HOME/bin

EOF

source /etc/profile